package com.taxi.entity.json;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.taxi.util.GeoPointUtil;
import org.geolatte.geom.Point;

import java.io.IOException;

/**
 * @Author Dell
 * @Date 2019/12/6 10:27
 */
public class PointCustomerSerializer extends JsonSerializer<Point> {

    @Override
    public void serialize(Point point, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
        jsonGenerator.writeString(GeoPointUtil.str(point));
    }

}
